local skel = fk.CreateSkill {
  name = "emo__huiwei",
  tags = {Skill.Compulsory},
}

Fk:loadTranslationTable{
  ["emo__huiwei"] = "回味",
  [":emo__huiwei"] = "每回合限一次，当一名角色发动其武将牌上没有的技能后，你摸一张牌。",
}

skel:addEffect(fk.AfterSkillEffect, {
  anim_type = "drawcard",
  can_trigger = function(self, _, target, player, data)
    if player:hasSkill(skel.name) and player:usedSkillTimes(skel.name, Player.HistoryTurn) == 0 and target then
      local skill = data.skill
      local name = (skill:getSkeleton() or skill).name
      if skill.is_delay_effect or skill.global or skill.cardSkill then return false end
      if Fk.generals[target.general] and table.contains(Fk.generals[target.general]:getSkillNameList(true), name) then return false end
      if Fk.generals[target.deputyGeneral] and table.contains(Fk.generals[target.deputyGeneral]:getSkillNameList(true), name) then return false end
      return true
    end
  end,
  on_use = function(self, _, target, player, data)
    player:drawCards(1, skel.name)
  end,
})

return skel
